﻿using Microsoft.Extensions.Configuration;
namespace LF.Application
{
    public class LFConfig
    {
        public static Jwt Jwt { get; set; }
        public static Weixin Weixin { get; set; }
        public static QyWeixin QyWeixin { get; set; }
        public static WeixinPay WeixinPay { get; set; }
        public static FilePath FilePath { get; set; }
        public static Aliyun Aliyun { set; get; }
        public static string Iot { get; set; }
        public static bool Debug { get; set; }
        public static string NormalPwd { get; set; }
        public static string FileHost { get; set; }

        public static string OaUrl { get; set; }

        public static string WorkWxApp { get; set; }

        public static string ServiceUrl { get; set; }
        /// <summary>
        /// 电子围栏半径
        /// </summary>
        public static double LimitDistance { get; internal set; }
        /// <summary>
        /// 腾讯地图API Key
        /// </summary>
        public static string TencentMapKey { get; set; }
        /// <summary>
        /// 高德地图API Key
        /// </summary>
        public static string AMapKey { get; set; }
    }

    public class Jwt
    {
        public double Expire { get; set; }
        public string SecurityKey { get; set; }
        public string Audience { get; set; }
        public string Issuer { get; set; }
    }

    public class QyWeixin
    {
        public string WeixinCorpId { get; set; }
        public string WeixinCorpAgentId { get; set; }
        public string WeixinCorpSecret { get; set; }
        /// <summary>
        /// 小程序ID
        /// </summary>
        public string AppId { get; set; }
        /// <summary>
        /// 企业微信群机器人Webhook Key
        /// </summary>
        public string GroupWebhookKey { get; set; }
    }
    public class Weixin
    {
        public string AppId { get; set; }
        public string Secret { get; set; }
        /// <summary>
        /// 正式版为 "release"，体验版为 "trial"，开发版为 "develop"。空值默为正式版。
        /// </summary>
        public string Mode { get; set; }
    }

    public class WeixinPay
    {
        /// <summary>
        /// 商户ID
        /// </summary>
       public string Id { get; set; }
        /// <summary>
        /// v3 api 密钥
        /// </summary>
        public string V3Secret { get; set; }
        /// <summary>
        /// SerialNumber
        /// </summary>
        public string SerialNumber { get; set; }
        /// <summary>
        /// 证书私钥<br/>
        /// 格式：-----BEGIN PRIVATE KEY-----微信商户证书私钥，即 `apiclient_key.pem` 文件内容-----END PRIVATE KEY-----
        /// </summary>
        public string PrivateKey { get; set; }
        /// <summary>
        /// 支付回调地址
        /// </summary>
        public string NotifyUrl { get; set; }
    }
    /// <summary>
    /// 文件目录
    /// </summary>
    public class FilePath
    {
        /// <summary>
        /// 相对路径
        /// </summary>
        public bool Relative { get; set; }
        /// <summary>
        /// 正式目录
        /// </summary>
        public string Path { get; set; }
        /// <summary>
        /// 缓存目录
        /// </summary>
        public string Temp { get;set;}
    }
    public class Aliyun
    {
        /// <summary>
        /// AccessKey ID
        /// </summary>
        public string AccessKeyId { get; set; }

        /// <summary>
        /// AccessKey Secret
        /// </summary>
        public string AccessKeySecret { get; set; }

        /// <summary>
        /// 短信签名
        /// </summary>
        public string SignName { get; set; }

        /// <summary>
        /// 短信模板
        /// </summary>
        public List<TemplateMap> Templates { get; set; }
    }

    public enum Template
    {
        /// <summary>
        /// 订单失败 参数：name管理员 address设备地点 code设备编号
        /// </summary>
        OrderError
    }


    public class TemplateMap
    {
        public Template Template { get; set; }
        public string Code { get; set; }
    }
}

